package com.imooc.sell.utils;

import com.imooc.sell.VO.ResultVO;

/**
 * @Description 封装在controller方法里面需要setData的步骤
 * @Author whf15
 * @Date 20:31 2021/10/19
 * @Param 
 * @return 
 **/
public class ResultVOUtil {
    public static ResultVO success(Object object){
        ResultVO resultVO = new ResultVO();
        resultVO.setData(object);
        resultVO.setCode(0);
        resultVO.setMsg("成功");
        return resultVO;
    }

    public static ResultVO success(){
        return success(null);
    }

    public static ResultVO error(Integer code, String msg){
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(code);
        resultVO.setMsg(msg);
        return resultVO;
    }
}
